import axios from "@/utils/axios";
const prefixUrl = {
  account: "/account",
  menu: "/menu",
  role: "/role",
};
export default {
  power: {
    create: "PUT:" + prefixUrl,
    update: "PUT:" + prefixUrl,
    delete: "DELETE:" + prefixUrl,
  },
  account: {
    query(params = {}) {
      return axios.get(prefixUrl.account, params);
    },
    create(params = {}) {
      return axios.post(prefixUrl.account, params);
    },
    update(params = {}) {
      return axios.put(prefixUrl.account, params);
    },
    delete(params = {}) {
      return axios.delete(prefixUrl.account, params);
    },
  },
  menu: {
    query(params = {}) {
      return axios.get(prefixUrl.menu, params);
    },
    create(params = {}) {
      return axios.post(prefixUrl.menu, params);
    },
    update(params = {}) {
      return axios.put(prefixUrl.menu, params);
    },
    delete(params = {}) {
      return axios.delete(prefixUrl.menu, params);
    },
  },
  role: {
    query(params = {}) {
      return axios.get(prefixUrl.role, params);
    },
    create(params = {}) {
      return axios.post(prefixUrl.role, params);
    },
    update(params = {}) {
      return axios.put(prefixUrl.role, params);
    },
    delete(params = {}) {
      return axios.delete(prefixUrl.role, params);
    },
  },
};
